const gulp = require('gulp');
const uglify = require('gulp-uglify');
const cssmin = require('gulp-cssmin');

const CopyFileTask = function () {
    console.log('copy -------- file');
    return gulp.src('./*.js').on("data", function (data) {
        console.log('data: ', data.path);
        return data;
    }).pipe(gulp.dest('./dist'));
};
function MinifyJs() {
    console.log('--------- minfiy js ---------');
    return gulp.src('./app2.js').pipe(uglify()).pipe(gulp.dest('./dist1'));
};

function MinifyCss(){
    console.log('--------- minfiy css ---------');
    return gulp.src('./demo.css').pipe(cssmin()).pipe(gulp.dest('./dist2'));
}

// exports.build = gulp.series(CopyFileTask,MinifyJs);
const buildTasks = gulp.parallel(MinifyCss, MinifyJs);
gulp.task('default', buildTasks);
